check for nil Name field in attr APIs#415
Conversation
The code which builds the input shapes for the GET_ATTRIBUTES and SET_ATTRIBUTES operations for attribute-based APIs was checking for a Name or ID field in order to set the value for ARN fields in the input shapes. However, some resources, like SNS' Subscription resources, do not have a Name or ID field. This resulted in nil pointer dereferencing and panics when building the controller for SNS Subscriptions. This patch simply double-checks that the `*string` returned from the `CRD.SpecIdentifierField()` method is not nil before adding in the Go code that constructs an ARN from a Name or ID field. Signed-off-by: Jay Pipes <jaypipes@gmail.com>
|
Hi @jaypipes. Thanks for your PR. I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
@jaypipes: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: A-Hilaly, jaypipes The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The code which builds the input shapes for the GET_ATTRIBUTES and SET_ATTRIBUTES operations for attribute-based APIs was checking for a Name or ID field in order to set the value for ARN fields in the input shapes. However, some resources, like SNS' Subscription resources, do not have a Name or ID field.
This resulted in nil pointer dereferencing and panics when building the controller for SNS Subscriptions.
This patch simply double-checks that the
*stringreturned from theCRD.SpecIdentifierField()method is not nil before adding in the Go code that constructs an ARN from a Name or ID field.Related: aws-controllers-k8s/community#1491
Signed-off-by: Jay Pipes jaypipes@gmail.com
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.